import vue from '@vitejs/plugin-vue';
import path from 'path';
import { defineConfig } from 'vite';
import electron from 'vite-plugin-electron';
import electronRender from 'vite-plugin-electron-renderer';

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		vue(),
		electron({
			entry: 'electron/index.js',
		}),
		electronRender(),
	],
	resolve: {
		// 配置路径别名
		alias: {
			'@': path.resolve(__dirname, './src'),
		},
	},
	build: {
		emptyOutDir: false,
	},
	optimizeDeps: {
		exclude: ['electron'],
	},
	base: './',
});
